/*
 * Vec2Dii.h
 *
 *  Created on: Jan 1, 2011
 *      Author: burek
 */

#ifndef Vec2DiI_H_
#define Vec2DiI_H_

struct Vec2Di
{
    int X, Y;

    inline Vec2Di( void ) {}
    inline Vec2Di( const int x, const int y )
    { X = x; Y = y; }

    inline Vec2Di operator = ( const Vec2Di& A )
    { X = A.X; Y = A.Y; return *this; }

    inline bool operator == ( const Vec2Di& A ) const
    { return X == A.X && Y == A.Y; }

    inline Vec2Di operator + ( const Vec2Di& A ) const
    { return Vec2Di( X + A.X, Y + A.Y ); }

    inline Vec2Di operator - ( const Vec2Di& A ) const
    { return Vec2Di( X - A.X, Y - A.Y ); }

    inline Vec2Di operator + ( const int A ) const
    { return Vec2Di( X + A, Y + A ); }

    inline Vec2Di operator * ( const int A ) const
    { return Vec2Di( X * A, Y * A ); }

    inline Vec2Di operator / ( const int A ) const
    { return Vec2Di( X / A, Y / A ); }

    inline float Length( void ) const
    { return sqrt(X * X + Y * Y); }

    inline void operator += ( const Vec2Di& A )
    { X += A.X; Y += A.Y; }

    inline void operator -= ( const Vec2Di& A )
    { X -= A.X; Y -= A.Y; }

    inline void operator *= ( const int A )
    { X *= A; Y *= A; }
};

#endif /* Vec2DiI_H_ */
